// Fill out your copyright notice in the Description page of Project Settings.


#include "MyAnimInstance.h"
#include "TianZhu/TianZhuCharacter.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "Kismet/KismetMathLibrary.h"
#include "Animation/AnimNotifies/AnimNotify.h"

void UMyAnimInstance::NativeInitializeAnimation()
{
	Super::NativeInitializeAnimation();
	MyCharacter = Cast<ATianZhuCharacter>(TryGetPawnOwner());
	if (MyCharacter) {

		MyCharacterMovement = MyCharacter->GetCharacterMovement();
	}
}

void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
	Super::NativeUpdateAnimation(DeltaSeconds);
	if (MyCharacterMovement) {
		Speed = UKismetMathLibrary::VSizeXY(MyCharacterMovement->Velocity);
		Jump_Z = MyCharacterMovement->Velocity.Z;
		IsInAir = MyCharacterMovement->IsFalling();
		
	}
}

void UMyAnimInstance::UpdateAnimationProperties()
{
}
